<?
global $base_dir;
$base_dir='../';

/**** 模块调用*****/
include_once($base_dir."inc/inc_connect.php");		//通用函数包含文件
include_once("index_inc.php");
include_once("func/function.php");
include_once($base_dir."inc/manage.php");			//后台通用包含文件
?>
<?
//接收参数
if(is_array($_GET))
{
	foreach($_GET as $key => $value)
	{
		$$key=$value;
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$lanmu_name?>-后台管理系统</title>
<link href="../style/common.css" rel="stylesheet" type="text/css" />
<script src="../js/checkform.js" type="text/javascript"></script>
<script type="text/javascript">
//删除确认
function delConfig(url,str)
{
	if(confirm(str))
	{
		location.href=url;
	}
}
</script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="lanmu_table">
  <tr>
    <td height="30" valign="bottom"><a href="<?=$url_list?>"><span class="lanmu_title"><?=$lanmu_name?></span></a><span class="lanmu_title2">&nbsp;&gt;&nbsp;列表</span></td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="margintop30_l">
<form action="" method="get" name="search">
  <tr>
    <td height="30" class="search"><strong>搜索:&nbsp;</strong>权限组名称：
      <input name="group_name" type="text" class="search_input" id="group_name" value="<?=$group_name?>" />
      <input name="Submit" type="submit" class="search_button" value="提交" /></td>
  </tr>
  </form>
</table>
<?
$pagesize=10;
$t=new Tbl_Act($tbl_name,$tbl_key);		//创建表对象
//$t->printsql=1;

//构建查询条件

$query_conv='where 1';

if($group_name!='')
{
	$t->$group_name=$group_name;
	$query_conv.=" and group_name like '%$group_name%'";
	$query_conv2[]='group_name,like';
}


//计算记录数量
$rs_num=$t->RsCount($query_conv2);
$pages=ceil($rs_num/$pagesize);
if($page>$pages)
{
	$page=$pages;
}
if($page<1)
{
	$page=1;
}
$sql_limit=" limit ".($page-1)*$pagesize.",$pagesize";
//$t->printsql=1;
$rows=$t->GetAll('*',$query_conv.' order by id desc'.$sql_limit);
?>
<table width="680" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999" class="margintop30_l">
  <tr>
    <td width="79" height="25" align="center" class="title01">编号</td>
    <td width="227" height="25" align="center" class="title01">权限组名称</td>
    <td width="116" height="25" align="center" class="title01"><a href="<?=$url_add?>" style="color:#C23734">增加记录</a></td>
  </tr>
<?
if(is_array($rows) && count($rows)>0)
{
	foreach($rows as $key => $row)
	{
		$td_id=$row[$tbl_key];
		$td_op='<a href="'.$url_mod.'?id='.$td_id.'">修改</a>&nbsp;&nbsp;<a href="javascript:delConfig(\''.$url_act.'?act=del&id='.$td_id.'\',\'确定删除？\')">删除</a>';
		$td1=$row['group_name'];		
?>
  <tr>
    <td height="25" bgcolor="#FFFFFF" class="list_td"><?=$td_id?></td>
    <td height="25" bgcolor="#FFFFFF" class="list_td"><?=$td1?></td>
    <td height="25" align="center" bgcolor="#FFFFFF" class="list_td"><?=$td_op?></td>
  </tr>
<?
	}
?>  
  <tr>
    <td height="25" colspan="3" align="right" bgcolor="#FFFFFF">
	<?
	$helfstyle='?page=@';
	if(is_array($_GET))
	{
		foreach($_GET as $key => $value)
		{
			if($key=='page')
			{
				continue;
			}
			$helfstyle.='&'.$key.'='.$value;
		}
	}
	echo getPageNum($page,$pages,5,$helfstyle);
	?>
	&nbsp;</td>
  </tr>
  
<?
}
else
{
?>
	<tr>
    	<td height="25" colspan="3" align="center" bgcolor="#FFFFFF">暂无内容&nbsp;...</td>
	</tr>
<?
}
?>
</table>
<!-- 7caihu.com Baidu tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fb8797ecb21d1ccb839c35b190277a0cd' type='text/javascript'%3E%3C/script%3E"));
</script>
</body>
</html>
<?
include_once($base_dir."inc/inc_unconnect.php")
?>